Networking
All information about the network protocol and packet structures will go here Login / Authentication Client Login Request The Client send a 892 byte packet to the server once the user clicks "Arenas". Most of the packet is the Auth Block of the wicket.vr1. Packet Structure Offset Type Description ------------------------------------------------- 0x0000 uint16 ?? always 0 0x0002 uint16 ?? always 0 0x0004 uint32 Opcode? 0x08 00 00 00 for login? 0x0008 uint16 ?? always 0 0x000A uint16 Client Port!! 0x000C uint32 ?? always 0xB 0x0010 uint32 ?? 0x00020010 (v20503), 0x00010000 (earlier versions) 0x0014 uint32 ?? always 0 0x0018 uint32 ?? always 0xFFF00001 0x001C uint32 ?? always 0 0x0020 uint32 ?? always 0xC 0x0024 uint32 ?? always 0x00010640 0x0028 uint32 ?? always 0xA 0x002C uint32 ?? 0x00010D31 (v20503), 0x00010651 (earlier versions) 0x0030 AuthBlock complete copy of the Auth Block The first two u16 and the u32 seem to be some kind of packet header. The fields that change with different versions might indicate different protocol versions. All other information is taken from the ticket. Login packets from different games (SARAC) are the same, save for the AuthBlock part. Server Response The client expects a response of 48 bytes. Packet Structure Offset Type Description ------------------------------------------------- 0x0000 uint16 ?? always 0 0x0002 uint16 ?? always 0 0x0004 uint32 Opcode? 0x98 00 00 00 for login? 0x0008 uint16 ?? always 2 0x000A uint16 Game Server Port 0x000C uint32 Game Server IP 0x0010 uint32 ?? 0x0014 uint32 ?? 0x0018 uint32 NTP Second 0x001C uint32 NTP Fractions 0x0020 uint16 ?? 0x0022 uint16 SlotID thingy. 0x0024 uint32 ?? always 0 0x0028 uint16 ?? 0x002A uint16 0x2066 on success, 0x0265 on auth failure? 0x002C uint32 ?? After after authentication to a "gateway server", the client is told the address and port of the game server running the game the client requested (ProductCode in the AuthBlock). I am not sure what the meaning of the SlotID thingy is. Anyway, any number can be set, and will from that moment on be sent by the client in every packet as uint16@0x0000. Right now I am working under the assumption that it is some kind of server slot. NTP is the Network Time Protocol. It is used for time synch across the internet. It is a 64 bit value. Upper 32 bit are seconds since 01.01.1900, lower 32 bit are fractions of a full second. Right now I am sending 0 for all the unknown fields. Suggestions from any sources welcome... Ping/Pong Client Ping Packet Structure Offset Type Description ------------------------------------------------- 0x0000 uint16 SlotID thingy 0x0002 uint16 ?? always 0 0x0004 uint32 Opcode? 0x40 00 00 00 0x0008 uint16 Ping sequence number 0x000a uint16 ?? always 0 Server Pong Packet Structure Offset Type Description ------------------------------------------------- 0x0000 uint16 0 0x0002 uint16 ?? always 0 0x0004 uint32 Opcode? 0x40 00 00 40 0x0008 uint32 milliseconds since ping sequence number 0 0x000c uint16 ?? can be 0x3ff, or a number 0-8 Some ID? 0x000e uint16 in response to ping sequence number The client spams a lot of these in the beginning, and then every 2 seconds or so.